import { createRouter, createWebHashHistory } from 'vue-router'
const Home = () =>
    import ( /* webpackChunkName: "Welcome" */ '../views/Home')
const Index = () =>
    import ( /* webpackChunkName: "Welcome" */ '../components/content/index/Index.vue')
const About = () =>
    import ( /* webpackChunkName: "Welcome" */ '../components/content/about/About.vue')
const Project = () =>
    import ( /* webpackChunkName: "Welcome" */ '../components/content/project/Project.vue')
const Message = () =>
    import ( /* webpackChunkName: "Welcome" */ '../components/content/message/Message.vue')
const Essay = () =>
    import ( /* webpackChunkName: "Welcome" */ '../components/content/essay/Essay.vue')

const routes = [{
    path: '/',
    redirect: '/home',
}, {
    path: '/home',
    name: 'home',
    component: Home,
    children: [
        { path: '/home', component: Index },
        { path: '/about', component: About },
        { path: '/project', component: Project },
        { path: '/message', component: Message },
        { path: '/essay', component: Essay },
    ]

}]

const router = createRouter({
    history: createWebHashHistory(),
    routes,
    linkExactActiveClass: 'nav-active'
})

export default router